package com.lanchetech.common.enums;

import lombok.Getter;

@Getter
public enum TenantTradeTypeEnum {
    // 收支类型 0 收入 1 支出
    PRODUCT((byte) 0, (byte) 0, "商品销售收入"),
    AFTER_SALE((byte) 1, (byte) 1, "商品退款支出"),
    WITHDRAW((byte) 2, (byte) 1, "提现支出"),
    SYSTEM_ADD((byte) 3, (byte) 0, "系统发放收入"),
    SYSTEM_SUB((byte) 4, (byte) 1, "系统扣除支出"),
    CLOSE_ORDERS((byte) 5, (byte) 1, "关闭订单支出"),
    ANCHOR_COMMISSION((byte) 6, (byte) 1, "主播佣金支出"),
    ANCHOR_COMMISSION_REFUND((byte) 7, (byte) 0, "主播佣金退回收入"),
    ;

    private Byte tradeType;
    private Byte type;
    private String remark;

    TenantTradeTypeEnum(Byte tradeType, Byte type, String remark) {
        this.tradeType = tradeType;
        this.type = type;
        this.remark = remark;
    }

    public static TenantTradeTypeEnum getByTradeType(Byte tradeType) {
        for (TenantTradeTypeEnum item : TenantTradeTypeEnum.values()) {
            if (item.getTradeType().equals(tradeType)) {
                return item;
            }
        }
        return null;
    }
}
